package com.food.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.food.configure.Result;
import com.food.entity.Food;
import com.food.entity.Hcw;
import com.food.mapper.HcwMapper;
import com.food.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/hello")
public class hello {
    @Autowired
    HcwMapper hcwMapper;
    /**
     * hello world
     */
    @GetMapping("/hello")
    public String man() {
        Hcw hcw = hcwMapper.selectOne(new LambdaQueryWrapper<Hcw>().eq(Hcw::getId, 1).last("limit 1"));
        String name = hcw.getName();
        System.out.println(name);
        return name ;
    }
}
